﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MobileIdeas.MobileTasks.SDK.DAL;
using MobileTasksService.Model.Entities;

namespace MobileIdeas.MobileTasks.MobileTasksService.Common
{
    public static class EntityTranslator
    {
        public static PermissionDto GetPermissionDto(Permission permission)
        {
            PermissionDto permissionDto = new PermissionDto();
            permissionDto.Name = permission.name;

            return permissionDto;
        }

        public static PermissionDto[] GetPermissionDtoArray(List<Permission> permissionList)
        {
            List<PermissionDto> permissionDtoList = new List<PermissionDto>();

            foreach (Permission permission in permissionList)
            {
                PermissionDto permissionDto = new PermissionDto();
                permissionDto.Name = permission.name;

                permissionDtoList.Add(permissionDto);
            }

            return permissionDtoList.ToArray();
        }
    }
}